<?php
// Acessory functions for doing things

require_once($_SERVER['DOCUMENT_ROOT'] . "/config.php");

// Modal window for errors
//  To be implemented

$logfile = ABS_PATH . "/logs/botmover_errors." . date("Ymd") . ".log";

function _log($what)
{
	global $logfile;
	
	file_put_contents($logfile, date("Y-m-d H:i:s") . " - " . $what . "\n", FILE_APPEND);
}

function uuid($prefix = '')
{
    $chars = md5(uniqid(mt_rand(), true));
    $uuid  = substr($chars,0,8) . '-';
    $uuid .= substr($chars,8,4) . '-';
    $uuid .= substr($chars,12,4) . '-';
    $uuid .= substr($chars,16,4) . '-';
    $uuid .= substr($chars,20,12);
    return $prefix . $uuid;
}

?>